package com.boyunv.iterator.example02;
/*
 *@description
 *
 *@author boyunv
 *@create 2023/9/1 7:23
 *@version 1.0
 */

public class Client {
    
    public static void main(String[] args) {
        Topic[] topics=new Topic[5];
        
        topics[0]=new Topic("t1");
        topics[1]=new Topic("t2");
        topics[2]=new Topic("t3");
        topics[3]=new Topic("t4");
        topics[4]=new Topic("t5");
        
        TopicList topicList = new TopicList(topics);
        IteratorIterator<Topic> iterator = topicList.iterator();
        
        while (iterator.hasNext()){
            Topic next = iterator.next();
            System.out.println(next.getName() );
        }
    }
}
